package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.bean.vo.wx.WxTopicListVo;
import com.cskaoyan.controller.promote.TopicController;
import com.cskaoyan.service.wx.WxTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: market-project
 * @BelongsPackage: com.cskaoyan.controller.wx
 * @CreateTime: 2022-11-22  14:57
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("wx/topic")
public class WxTopic {
    @Autowired
    WxTopicService wxTopicService;

    @Autowired
    TopicController topicController;

    @RequestMapping("detail")
    public BaseRespVo WxCouponDetail(Integer id) {
        return topicController.topicRead(id);
    }

    @RequestMapping("related")
    public BaseRespVo WxCouponRelated(Integer id) {
        CommonData data = wxTopicService.selectById(id);
        return BaseRespVo.succeed(data);
    }

    @RequestMapping("list")
    public BaseRespVo WxCouponList(Integer page, Integer limit) {
        CommonData<WxTopicListVo> commonData = wxTopicService.select2WxTopicListVo(page,limit);
        return BaseRespVo.succeed(commonData);
    }


}